/*
 * @Author       : Hejh(3010733382@qq.com)
 * @Version      : V1.0
 * @Date         : 2024-04-26 09:39:28
 * @Description  : 文件上传相关接口
 */

import request from '@/utils/request'
import type {
  FileHandSharkReq,
  FileChunkUploadReq,
  FileUploadRes
} from '@/types/file'
// 文件协商接口
export const fileHandShark = (data: FileHandSharkReq) => {
  return request.post<FileUploadRes>('/file/handshark', data)
}

// 文件分片上传接口
export const fileChunkUpload = (data: FormData) => {
  return request.post<FileUploadRes>('/file/upload', data, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}
